use super::hitls_cert_type::HITLS_CERT_X509;
use super::hitls_type::{HITLS_Config, HITLS_Ctx};
pub const HITLS_EX_TYPE_CLIENT_HELLO: u32 = 1;
pub const HITLS_EX_TYPE_TLS1_2_SERVER_HELLO: u32 = 2;
pub const HITLS_EX_TYPE_TLS1_3_SERVER_HELLO: u32 = 4;
pub const HITLS_EX_TYPE_HELLO_RETRY_REQUEST: u32 = 8;
pub const HITLS_EX_TYPE_ENCRYPTED_EXTENSIONS: u32 = 16;
pub const HITLS_EX_TYPE_TLS1_3_CERTIFICATE: u32 = 32;
pub const HITLS_EX_TYPE_TLS1_3_CERTIFICATE_REQUEST: u32 = 64;
pub const HITLS_EX_TYPE_TLS1_3_NEW_SESSION_TICKET: u32 = 128;
pub const HITLS_ADD_CUSTOM_EXTENSION_RET_PACK: u32 = 1;
pub type HITLS_AddCustomExtCallback = ::std::option::Option<
    unsafe extern "C" fn(
        ctx: *const HITLS_Ctx,
        extType: u16,
        context: u32,
        out: *mut *mut u8,
        outLen: *mut u32,
        cert: *mut HITLS_CERT_X509,
        certIndex: u32,
        alert: *mut u32,
        addArg: *mut ::std::os::raw::c_void,
    ) -> ::std::os::raw::c_int,
>;
pub type HITLS_FreeCustomExtCallback = ::std::option::Option<
    unsafe extern "C" fn(
        ctx: *const HITLS_Ctx,
        extType: u16,
        context: u32,
        out: *mut u8,
        addArg: *mut ::std::os::raw::c_void,
    ),
>;
pub type HITLS_ParseCustomExtCallback = ::std::option::Option<
    unsafe extern "C" fn(
        ctx: *const HITLS_Ctx,
        extType: u16,
        context: u32,
        in_: *mut *const u8,
        inLen: *mut u32,
        cert: *mut HITLS_CERT_X509,
        certIndex: u32,
        alert: *mut u32,
        parseArg: *mut ::std::os::raw::c_void,
    ) -> ::std::os::raw::c_int,
>;
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct HITLS_CustomExtParams {
    pub extType: u16,
    pub context: u32,
    pub addCb: HITLS_AddCustomExtCallback,
    pub freeCb: HITLS_FreeCustomExtCallback,
    pub addArg: *mut ::std::os::raw::c_void,
    pub parseCb: HITLS_ParseCustomExtCallback,
    pub parseArg: *mut ::std::os::raw::c_void,
}
unsafe extern "C" {
    pub fn HITLS_AddCustomExtension(
        ctx: *mut HITLS_Ctx,
        params: *const HITLS_CustomExtParams,
    ) -> u32;
}
unsafe extern "C" {
    pub fn HITLS_CFG_AddCustomExtension(
        config: *mut HITLS_Config,
        params: *const HITLS_CustomExtParams,
    ) -> u32;
}
